﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace StockPredictor.Models
{
    public class AlgorithmHistoryKey
    {
        public int userId { get; set; }
        public double EPS { get; set; }
        public double PERatio { get; set; }

        public override int GetHashCode()
        {
            int result = userId + (int)EPS + (int)PERatio;

            return result;
        }
        public override bool Equals(object obj)
        {
            if (!(obj is AlgorithmHistoryKey))
            {
                return false;
            }
            if (((AlgorithmHistoryKey)obj).userId != userId)
            {
                return false;
            }
            if (((AlgorithmHistoryKey)obj).EPS != EPS)
            {
                return false;
            }
            if (((AlgorithmHistoryKey)obj).PERatio != PERatio)
            {
                return false;
            }

            return true;
        }
    }
}